using System;
using System.Runtime.InteropServices;

namespace Framework.Interop
{
	// ReSharper disable InconsistentNaming
	///<summary>
	/// This structure is used with the <see cref="Shell32.SHCreateShellFolderView">SHCreateShellFolderView</see> function.
	///<seealso>
	/// Native <see cref="http://msdn.microsoft.com/en-us/library/bb773399.aspx">structure</see>
	///</seealso>
	///</summary>
	[ComVisible(false)]
	[CLSCompliant(false)]
	public struct ShellFolderViewCreate
	{
		///<summary>
		/// Create a instance of <see cref="ShellFolderViewCreate">Sfv_Create</see> with no callback
		///</summary>
		///<param name="pshf">The <see cref="IShellFolder">IShellFolder</see> interface of the folder for which to create the view.</param>
		public ShellFolderViewCreate(IShellFolder pshf)
			: this(pshf, null)
		{
		}

		///<summary>
		/// Create a instance of <see cref="ShellFolderViewCreate">Sfv_Create</see>
		///</summary>
		///<param name="pshf">The <see cref="IShellFolder">IShellFolder</see> interface of the folder for which to create the view.</param>
		///<param name="psfvcb">A pointer to the <see cref="IShellFolderViewCB">IShellFolderViewCB</see> interface that handles the view's callbacks when various events occur. This parameter may be NULL.</param>
		///<overloads>Create a instance of <see cref="ShellFolderViewCreate">Sfv_Create</see> with callback or without</overloads>
		public ShellFolderViewCreate(IShellFolder pshf, IShellFolderViewCB psfvcb)
		{
			cbSize = (uint) Marshal.SizeOf(typeof(ShellFolderViewCreate));
			this.pshf = pshf;
			this.psvOuter = null;
			this.psfvcb = psfvcb;
		}

		///<summary>
		/// The size of the <see cref="ShellFolderViewCreate">Sfv_Create</see> structure, in bytes.
		///</summary>
		public uint cbSize;
		///<summary>
		/// The <see cref="IShellFolder">IShellFolder</see> interface of the folder for which to create the view.
		///</summary>
		[MarshalAs(UnmanagedType.Interface)] public IShellFolder pshf;
		///<summary>
		/// A pointer to the parent IShellView interface. This parameter may be NULL. This parameter is used only when the view created by <see cref="Shell32.SHCreateShellFolderView">SHCreateShellFolderView</see> is hosted in a common dialog box.
		///</summary>
		public object psvOuter;
		///<summary>
		/// A pointer to the <see cref="IShellFolderViewCB">IShellFolderViewCB</see> interface that handles the view's callbacks when various events occur. This parameter may be NULL.
		///</summary>
		[MarshalAs(UnmanagedType.Interface)] public IShellFolderViewCB psfvcb;
	}
	// ReSharper restore InconsistentNaming
}
